import request from '@/utils/request'
import request3 from '@/utils/request3'

export function getBaseInfo(parameter) {
    return request({
        url: '/UserEnterprise/GetEnterpriseConfigs',
        method: 'get',
        params: parameter
    })
}
export function GetQueryupText(parameter) {
    return request({
        url: '/InfoApplyProfession/GetQueryupText',
        method: 'get',
        params: parameter
    })
}
export function updateModifyPostNew(data) {
    return request3({
        url: '/UserEnterprise/ModifyPostNew?key=Master',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        method: 'post',
        data
    })
}

export function updateModifyPostNew_RiskManagerInfo(data) {
    return request({
        url: '/UserEnterprise/ModifyPostNew?key=RiskManagerInfo',
        method: 'post',
        data
    })
}
export function updateRiskPointInfoModifyPostNew(data) {
    return request({
        url: '/UserEnterprise/ModifyPostNew?key=RiskPointInfo&childKey=DangerousOperation',
        method: 'post',
        data
    })
}
export function updateRiskPointInfoModifyPostNew2(key,childeKey,data) {
    return request3({
        url: '/UserEnterprise/ModifyPostNew?key='+key+'&childKey='+childeKey,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        method: 'post',
        data
    })
}
//给 单项展示的 设置用SingleHolder
export function updateRiskPointInfoModifyPostNew3(key,data) {
    return request3({
        url: '/UserEnterprise/ModifyPostNew?key='+key,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        method: 'post',
        data
    })
}

export function getUserInfo() {
    return request({
        url: '/UserUser/GetMyInfo',
        method: 'get',
    })
}


export function getTemplateList() {
    return request({
        url: '/InfoEnterpriseConfigDefine/GetPageData',
        method: 'get',
    })
}

export function getStatusText(status){
    switch (status) {
        case 10:
            return "待提交";
        case 15:
            return "退回的检查记录";
        case 20:
            return "待确认";
        case 30:
            return "待指派";
        case 40:
            return "待制定措施";
        case 45:
            return "待审批";
        case 50:
            return "待整改";
        case 60:
            return "待验收";
        case 100:
            return "验收通过";
        case 200:
            return "闭环审批中";
        case 250:
            return "闭环";
    }
    return "";
}